package com.apexsoft.assets.base.exception;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by Administrator on 2018/3/21.
 */
public class ValidException extends RuntimeException {
    private Map<String, String> error;

    public ValidException(Map<String, String> error) {
        super("数据校验异常");
        if (error == null) {
            this.error = new HashMap<>();
        } else {
            this.error = error;
        }

    }

    public Map<String, String> getError() {
        return error;
    }

    public void setError(Map<String, String> error) {
        this.error = error;
    }

    public void setParamError(String field, String errorNote) {
        error.put(field, errorNote);
    }

    @Override
    public String getMessage() {
        return super.getMessage();
    }
}
